{% extends "../../index.html" %}


{% block page-title %}Pastes ({{ paste_count }}){% endblock %}

{% block h1 %}All pastes{% endblock %}

{% block h1-headers %}{% endblock %}

{% block page-content %}
{% if pastes %}
<table>
    <tr>
        <th width="20%">Date</th>
        <th>Title</th>
        <th width="20%">User</th>
    </tr>
        {% for paste in pastes %}
        <tr>
            <td>{{ paste.posted_at }}</td>
            <td><a href="{{ paste.u }}">{{ paste.title }}</a></td>
            <td>{{ paste.user_name }}</td>
        </tr>
        {% endfor %}
    {% if pages %}
    <tfoot>
        <tr>
            <td colspan="3">
                <ul class="paging">
                {%for page in pages %}
                    <li>
                    {% ifequal page.0 -1 %}
                        ...
                    {% endifequal %}

                    {% ifnotequal page.0 -1 %}
                    <a href="{{ page.1 }}">{% if page.2 %}<span>{% endif %}{{ page.0 }}{% if page.2 %}</span>{% endif %}</a>
                    {% endifnotequal %}
                    </li>
                {% endfor %}
            </td>
        </tr>
    {% endif %}

</table>

</table>

{% else %}
    <p class="info"><strong>There are no pastes for now.</strong></p>
    <ul>
        <li><a href="/">Paste some code</a></li>
    </ul>
{% endif %}

{% endblock %}
